<extend name="Public/layout"/>

<block name="body">
    <div class="row">
        <div class="col-xs-12">
            <div class="box flat box-primary">
                <div class="box-body aaaaaa" id="{$boxId}">


                    <div class="table-wrap">

                        <table id="{$tableId}3"
                               class="table table-bordered table-hover table-condensed table-nowrap" style="margin-top: 10px;"
                               data-table-name="{$tableId}3">
                            <thead>
                            <tr><th colspan="3" style="background: linear-gradient(45deg, #1cbbb4,#0081ff);">今日预估服务费：{$alldata['today_yugu']||default="0"}</th></tr>
                            <tr>
                                <th style="text-align: center;vertical-align: middle;">#</th>
                                <th style="text-align: center">用户名</th>
                                <th style="text-align: center">预估服务费</th>
                            </tr>

                            </thead>
                            <tbody>
                            <foreach name="paihangbang" item="row">
                            <tr>
                                <td style="text-align: center"><php>$i += 1;echo $i</php></td>
                                <td style="text-align: center">{$row['username']}</td>
                                <td style="text-align: center">{$row['money']}</td>
                            </tr>
                            </foreach>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script>
        $(function () {
            $('.form-control.date.datepicker').change(function () {
                $(this).prev().val($(this).val());
            });

            $('.datepicker').each(function () {
                var $this = $(this);
                var dateType = $(this).attr('data-type');
                var handle = "datepicker";
                var format = "yyyy-mm-dd";
                var options = {
                    language: 'zh-CN',
                    autoclose: true,
                    templates: {
                        leftArrow: '<i class="fa fa-caret-square-o-left"></i>',
                        rightArrow: '<i class="fa fa-long-arrow-right"></i>'
                    },
                }
                switch (dateType) {
                    case 'timestamp':
                    case 'datetime':
                        format = "yyyy-mm-dd hh:ii";
                        handle = 'datetimepicker';
                        break;
                    case 'date':
                        format = "yyyy-mm-dd";
                        handle = 'datepicker';
                        break;
                }
                options.format = format;
                var fieldName = $this.attr('data-name');
                $this[handle](options)
                    .on('changeDate,change', function (e) {
                        var value = $(e.currentTarget).val();
                        $('input[name=' + fieldName + ']').val(value);
                    });
            });
        });
    </script>
</block>